from flask_apscheduler import APScheduler
from apscheduler.schedulers.background import BackgroundScheduler

# 启动定时任务
scheduler = APScheduler(BackgroundScheduler(timezone="Asia/Shanghai"))

# 定时任务配置

class Config:
    JOBS = [        
        {
            "id":"999",
            "func":"api.timetask:job_999",
            "trigger":"interval",
            "seconds":30
        }
    ]
    # 一定要开启API功能，这样才可以用api的方式去查看和修改定时任务
    SCHEDULER_TIMEZONE = 'Asia/Shanghai'
    SCHEDULER_API_ENABLED = True

def job_999():
    pass
    # print("定时任务测试！")


